<?php

/**
 * 后台店长基类
 */

namespace Base;
use Base\BackController;

class BackManagerController extends BackController {

    public function _initialize() {
        parent::_initialize();
        //判断用户是否为店员管理人员,如果是的话筛选条件有少许不同
        $this->manager_filter=false;
        $manager_ids = array_keys(C('sale_managers'));
        if(in_array($this->back_user_id, $manager_ids)){
          //是manager
          $this->manager_filter=$this->back_user_id;
          $all_manager=C('sale_managers');
          C('sale_managers',array($this->back_user_id=>$all_manager[$this->back_user_id]));
        }
        //判断当前登录者是否为消费者管理人员,如果是则只能查看他们掌控的邀请码下的消费者
        $carr=C('ccc_ids');
        $ccc_ids = array_keys($carr);
        if(in_array($this->back_user_id, $ccc_ids)){
          $this->ccc_filter=$carr[$this->back_user_id];

        }

    }
}
